public class Test {
    static class Solution {
        public void rotate(int[] nums, int k) {
            int[] s = new int[nums.length];
            for(int i=0; i<nums.length; i++){
                s[(i+k)%nums.length] = nums[i];
            }
            System.out.println(s.toString());
        }
    }

    public static void main(String[] args) {
        Solution solution = new Solution();

        int[] nums = {1,2,3,4,5};
        solution.rotate(nums, 3);
    }
}
